/***************************************************************************//**
 * @file GUI/DialogTest.h
 * @author  Marek M. Cel <marekcel@mscsim.org>
 *
 * @section LICENSE
 *
 * Copyright (C) 2014 Marek M. Cel
 *
 * This file is part of MScSim. You can redistribute and modify it under
 * the terms of GNU General Public License as published by the Free Software
 * Foundation; either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 * for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.
 * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 * Further information about the GNU General Public License can also be found
 * on the world wide web at http://www.gnu.org.
 ******************************************************************************/
#ifndef DIALOG_TEST_H
#define DIALOG_TEST_H

////////////////////////////////////////////////////////////////////////////////

#include <QDialog>
#include <QUdpSocket>

#include "GUI_Data.h"

#include "net_ctrls.hxx"
#include "net_fdm.hxx"

////////////////////////////////////////////////////////////////////////////////

namespace Ui
{
    class DialogTest;
}

////////////////////////////////////////////////////////////////////////////////

class DialogTest : public QDialog
{
    Q_OBJECT

public:

    explicit DialogTest( QWidget *parent = 0 );

    virtual ~DialogTest();

    void update( double timeStep );

    void updateDataInp( GUI_DataInp &dataInp );
    void updateDataOut( GUI_DataOut &dataOut );

private slots:

    void on_pushButtonFGFS_Off_clicked();
    void on_pushButtonFGFS_On_clicked();

private:

    Ui::DialogTest *m_ui;   ///< Qt UI object

    GUI_Data *m_data;

    QUdpSocket *m_sockCtr;
    QUdpSocket *m_sockFdm;

    FGNetCtrls m_netCtr;
    FGNetFDM   m_netFdm;

    bool m_dataFromFGFS;

    void dataFromGUI();

    void dataFromFGFS();
    void receiveDataFromFGFS();
};

////////////////////////////////////////////////////////////////////////////////

#endif // DIALOG_TEST_H
